import { HttpRequest } from 'xo-web-base';

export class FileService {
  /**
   * 文件上传
   * @param params
   * @param onProgress 进度回调
   * @returns
   */
  static upload(
    params: Record<any, any>,
    onProgress?: (percent: number) => void,
  ) {
    return HttpRequest.upload<string>(
      '/service/file/upload',
      params,
      onProgress,
    );
  }
}
